package android07.newtop.activity;

import android.os.Build;
import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.NavigationView;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.MenuItem;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.Toast;

import com.jude.beam.bijection.RequiresPresenter;
import com.jude.beam.expansion.data.BeamDataActivity;

import android07.newtop.R;
import android07.newtop.model.bean.WeatherInfoBean;
import android07.newtop.presenter.WeatherActivityPresenter;

/**
 * 天气页面
 * 多城市天气页面
 *

 *
 * Created by hy on 2016/10/17
 */
@RequiresPresenter(WeatherActivityPresenter.class)
public class WeatherActivity extends BeamDataActivity<WeatherActivityPresenter, WeatherInfoBean>{
    private static final String TAG = WeatherActivity.class.getSimpleName();
    Toolbar toolbar;
    ViewPager viewPager;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
        }
        setContentView(R.layout.weather_activity);
        initView();


        //设置toolbar
        setSupportActionBar(toolbar);
        AppBarLayout.LayoutParams param = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();
        param.setMargins(0, 0, 0, 0);
        toolbar.setLayoutParams(param);
    }

    private void initView() {

        toolbar = (Toolbar) findViewById(R.id.toolbar);

        viewPager = (ViewPager) findViewById(R.id.viewPager);
        //        tabLayout = (TabLayout) findViewById(R.id.tabLayout);
//       tabLayout.setTabMode(TabLayout.MODE_FIXED);
    }


    /**
     * 给其他类获得viewpage的方法
     *
     * @return
     */
    public ViewPager getViewPager() {
        return viewPager;
    }

//
    /**
     * 给其他类获得TableLayout的方法
     *
     * @return
     */
    public Toolbar getToolbar() {
        return toolbar;
    }







}
